//
//  GDLeftCell.m
//  美团试验 (自己)
//
//  Created by 热带雨林 on 17/2/13.
//  Copyright © 2017年 热带雨林. All rights reserved.
//

#import "GDLeftCell.h"
#import "CZAdditions.h"
#import "Masonry.h"


@implementation GDLeftCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
        [self setupUI];
    }
    return self;
}

- (void)setupUI{

    self.backgroundColor = [UIColor cz_colorWithHex:0xf8f8f8];
    
    self.textLabel.font = [UIFont systemFontOfSize:12];
    self.textLabel.textColor = [UIColor cz_colorWithHex:0x464646];
    self.textLabel.numberOfLines = 2;
    
    UIView *selectedView = [[UIView alloc]init];
    selectedView.backgroundColor = [UIColor lightGrayColor];
    self.selectedBackgroundView = selectedView;
    
    UIView *yellowView = [[UIView alloc]init];
    yellowView.backgroundColor = [UIColor grayColor];
    yellowView.layer.cornerRadius = 3;
    yellowView.layer.masksToBounds = YES;
    [selectedView addSubview:yellowView];
    
    //分割线
    UIView *line = [[UIView alloc]init];
    line.backgroundColor = [UIColor grayColor];
    
    [self.contentView addSubview:line];
    
    [yellowView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.width.mas_equalTo(7);
        make.height.mas_equalTo(37);
        make.centerY.equalTo(selectedView);
        
    }];
    
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(self.contentView);
        //设置分割线的意义
        make.height.mas_equalTo(1/[UIScreen mainScreen].scale);
    }];
    
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
